package com.xugongzhang.spring.annotations;

import com.xugongzhang.spring.beans.Person;
import org.springframework.stereotype.Component;

/**
 * @author X
 * @date 2022/12/1 1:17
 */
@Component
public class AnnotationTest {
    public static void main(String[] args) throws IllegalAccessException {
        Person person = new Person();
        person.setName("134");
        person.setAge(10);
        person.setId("001");
        String validateField = LengthValidator.validateField(person);
        if (validateField == null) {
            System.out.println(person);
        }
        else {
            System.out.println(validateField);
        }
    }
}
